package com.ruoyi.system.domain.dto;

import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;

import java.util.List;

/**
 * @Auther Lyuuji
 * @Date 2023/12/21
 * @Description
 */

@Data
public class ToolJsonResponseDto {
    @JSONField(name = "tool_name")
    private String toolName;

    @JSONField(name = "description")
    private String description;

    @JSONField(name = "request_type")
    private String requestType;

    @JSONField(name = "prompt")
    private String prompt;

    @JSONField(name = "base_url")
    private String baseUrl;

    @JSONField(name = "path")
    private String path;

    @JSONField(name = "headers")
    private ToolJsonResponseDto.Headers headers;

    @JSONField(name = "params")
    private Object params;

    @JSONField(name = "body")
    private ToolJsonResponseDto.Body body;

    @JSONField(name = "response_content")
    private ToolJsonResponseDto.ResponseContent responseContent;

    @JSONField(name = "tool_set_role")
    private String toolSetRole;

    @Data
    public static class Headers {
        @JSONField(name = "Content-Type")
        private String contentType;
    }

    @Data
    public static class Body {
        @JSONField(name = "type")
        private String type;

        @JSONField(name = "properties")
        private List<ToolJsonResponseDto.Body.Properties> properties;

        @JSONField(name = "properties_json")
        private String propertiesJson;

        @JSONField(name = "required")
        private List<ToolJsonResponseDto.Body.Required> required;

        @Data
        public static class Properties {
            @JSONField(name = "name")
            private String name;

            @JSONField(name = "type")
            private String type;

            @JSONField(name = "description")
            private String description;
        }

        @Data
        public static class Required {
            @JSONField(name = "paramName")
            private String paramName;

            @JSONField(name = "paramPath")
            private String paramPath;

            @JSONField(name = "description")
            private String description;
        }
    }

    @Data
    public static class ResponseContent {
        @JSONField(name = "type")
        private String type;

        @JSONField(name = "properties")
        private String properties;

        @JSONField(name = "required")
        private List<ToolJsonResponseDto.ResponseContent.Required> required;

        @Data
        public static class Required {
            @JSONField(name = "resultName")
            private String resultName;

            @JSONField(name = "description")
            private String description;
        }
    }
}
